<!doctype html>
<html class="no-js" lang="zxx" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>个人房屋</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" type="image/x-icon" href="http://localhost:8080/assets/img/favicon.ico">
    <script src="http://localhost:8080/assets/js/main.js"></script>

    <!-- CSS here -->
    <link rel="stylesheet" href="http://localhost:8080/assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/owl.carousel.min.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/slicknav.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/animate.min.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/magnific-popup.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/fontawesome-all.min.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/themify-icons.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/slick.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/nice-select.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/style.css">
</head>
<body>
<div th:replace="template.html::header"></div>
<main th:object="${user}">
    <!-- Hero Area Start-->
    <div class="slider-area gray-bg position-relative">
        <div class="single-slider d-flex align-items-center slider-height2">
            <div class="container">
                <div class="row">
                    <div class="col-xl-12">
                        <div class="hero-caption hero-caption2">
                            <h2 th:text="${user.getName()} + |的个人房屋|"></h2>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Hero Area End -->

    <div class="job_details_area section-bg2">
        <div class="container">
            <div class="row">
                <div class="col-lg-8">
                    <div class="recent_joblist_wrap">
                        <div class="recent_joblist white-bg ">
                            <div class="row align-items-center">
                                <div class="col-md-6">
                                    <h4>房屋列表</h4>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-12" id="list">
                        <div class="job_details_header" th:each="house : ${user_personal_houses}">
                            <div class="single_jobs white-bg d-flex justify-content-between">
                                <div class="jobs_left d-flex align-items-center">
                                    <div class="thumbx">
                                        <a th:href="'rent-house?id=' + ${house.getId()}">
                                            <img th:src="${house.getPic()}" alt="">
                                        </a>
                                    </div>
                                    <div class="jobs_conetent">
                                        <a th:href="'rent-house?id=' + ${house.getId()}"><h4
                                                th:text="${house.getName()}"></h4></a>
                                    </div>
                                </div>
                                <div class="jobs_right">
                                    <div class="apply_now">
                                        <form method="post" action="change-house-is-rent">
                                            <label style="display: none">
                                                <input type="text" name="house-id" th:value="${house.getId()}">
                                            </label>
                                            <button type="submit" th:if="${house.getIsRent()}" class="boxed-btn4">取消已租用
                                            </button>
                                        </form>
                                        <div class="apply_now">
                                            <a class="boxed-btn4" th:href="'modify-house?id=' + ${house.getId()}">编辑</a>
                                        </div>
                                        <form method="post" action="delete-house" class="apply_now">
                                            <label style="display: none">
                                                <input type="text" name="house-id" th:value="${house.getId()}">
                                            </label>
                                            <button type="submit" class="boxed-btn4" style="background-color: red">删除房屋
                                            </button>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-12">
                        <div class="job_filter white-bg">
                            <div class="form_inner white-bg">
                                <div class="row">
                                    <div style="display: flex;margin: auto;" class="single_field">
                                        <input onclick="add(-1)" class="boxed-btn3" style="margin-right: 20px"
                                               value="上一页">
                                        <input onchange="change(this.value)" id="pager" type="number"
                                               value="1" min="1" disabled>
                                        <input onclick="add(1)" class="boxed-btn3" style="margin-left: 20px"
                                               value="下一页">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-4">
                    <div class="job_sumary">
                        <div class="summery_header">
                            <h3 th:text="${user.getName()}"></h3>
                        </div>
                        <div class="job_content">
                            <ul>
                                <li>账号: <span th:text="${user.getAccount()}"></span></li>
                                <li>电话: <span th:text="${user.getPhone()}"></span></li>
                            </ul>
                        </div>
                    </div>
                    <div class="share_wrap d-flex">
                        <a href="add-house" class="boxed-btn3 w-100" type="submit">添加房屋</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
<div th:replace="template.html::footer"></div>
<!-- Scroll Up -->
<div id="back-top">
    <a title="Go to Top" href="#"> <i class="fas fa-level-up-alt"></i></a>
</div>

</body>
</html>